import {MockMethod} from "vite-plugin-mock";
import {userList} from "./data";

export default [
    {
        url: '/permission/getUserRole',
        method: 'POST',
        timeout: 211,
        response: ({body}) => {
            if (body.username === 'admin' && body.password === 'admin' && body.verifyStatus === 'success') {
                return {
                    status: 200,
                    data: {
                        token: userList['token'],
                    },
                    message: "登录成功",
                }
            } else {
                return {
                    status: 401, // 未授权
                    data: null,
                    message: "登录失败"
                }
            }
        }
    }
] as MockMethod[]